package com.spsoft.system.controller;


import com.spsoft.core.annotation.AnonymousAccess;
import com.spsoft.core.annotation.Log;
import com.spsoft.core.controller.BaseController;
import com.spsoft.core.enums.LogActionType;
import com.spsoft.core.enums.LogMenuEnum;
import com.spsoft.core.model.Result;
import com.spsoft.system.model.vo.DefBizdictVo;
import com.spsoft.system.service.DefBizdictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *   数据字典视图 前端控制器
 * </p>
 *
 * @author dlchen
 * @since 2023-11-07
 */
@Api(tags = {"数据字典 "})
@RestController
@RequestMapping("/defBizdict")
@RequiredArgsConstructor
@Validated
@Slf4j
public class DefBizdictController extends BaseController {

   private final  DefBizdictService defBizdictService;

    @ApiOperation("根据类型代码获取数据字典")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "lxdm", value = "数据字段类型代码", dataTypeClass=String.class,dataType = "String", paramType = "query", required = true),
    })
    @AnonymousAccess(value = "/getDefBIzdictByLxdm", method = RequestMethod.GET,permissionCode = "")
//    @Log(value = "根据类型代码获取数据字典", type = LogActionType.SELECT,  menuName = LogMenuEnum.SYSTEM_BASIC_INFO)
    public Result<List<DefBizdictVo>> getDefBIzdictByLxdm(String lxdm) {
        return defBizdictService.getDefBIzdictByLxdm(lxdm);
    }
}

